package com.itheima.mall.controller;

import com.itheima.mall.pojo.Demo;
import com.itheima.mall.service.AdminDemoService;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/demo")
public class AdminDemoController {

    @Resource
    private AdminDemoService adminDemoService;

    @GetMapping("/getDemo")
    public ResponseEntity<Demo> getDemo(){
        String name = "蔡徐坤";
        long age = 30;
        Demo demo = adminDemoService.getDemo(name,age);
        return ResponseEntity.ok(demo);
    }



}
